/**
 *
 */
package de.cbf.cam.dsa.item;

import java.util.ArrayList;
import java.util.List;

/**
 * @author salter
 *
 */
public abstract class AbstractController {

	protected List<AbstractController> subController;
	/**
	 *
	 */
	public AbstractController() {
		init();
	}

	protected void init(){
		subController = new ArrayList<AbstractController>();
	}

	protected void addSubController(AbstractController controller){
		subController.add(controller);
	}

	protected void removeSubController(AbstractController controller){
		subController.remove(controller);
	}

	protected void notifySubControllers(Integer index){
		for (AbstractController controller : subController) {
			controller.regardNotification(index);
		}
	}

	protected abstract void regardNotification(Integer index);
}
